<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of Annuaire.
 
Annuaire is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Annuaire is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Annuaire.  If not, see <http://www.gnu.org/licenses/>.
-->
<!-- $Id$ -->
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
	<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes" encoding="UTF-8"/>
	<xsl:param name="versionParam" select="'1.0'"/>
	<xsl:param name="pathParam"/>
	<!-- ========================= -->
	<!-- root element: projectteam -->
	<!-- ========================= -->
	<xsl:template match="annuaire">
		<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
			<fo:layout-master-set>
				<fo:simple-page-master master-name="Intro" page-height="29.7cm" page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
					<fo:region-body/>
				</fo:simple-page-master>
				<fo:simple-page-master master-name="corps" page-height="29.7cm" page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
					<fo:region-body margin-top="1.5cm"/>
					<fo:region-before extent="3cm"/>
					<fo:region-after extent="0.5cm"/>
				</fo:simple-page-master>
			</fo:layout-master-set>

				<!-- =========================== -->
				<!-- Page de Garde de l'Annuaire -->
				<!-- =========================== -->
			<fo:page-sequence master-reference="Intro">
				<fo:flow flow-name="xsl-region-body">
					<fo:block margin-top="300pt" font-size="24pt" font-weight="bold" space-after="2mm">Paris Ouest Nanterre La Défense</fo:block>
					<fo:block font-size="60pt" font-weight="bold" space-after="5mm" break-after="page">ANNUAIRE</fo:block>
				</fo:flow>
			</fo:page-sequence>

				<!-- =========== -->
				<!--  l'Annuaire -->
				<!-- =========== -->
			<fo:page-sequence master-reference="corps">
				<!-- Entête -->
				<fo:static-content flow-name="xsl-region-before">
					<fo:table table-layout="fixed" width="100%" border-collapse="separate">
						<fo:table-column column-width="6cm"/>
						<fo:table-column column-width="5cm"/>
						<fo:table-column column-width="3cm"/>
						<fo:table-column column-width="3cm"/>
						<fo:table-body>
							<fo:table-cell>
								<fo:block>
									<fo:external-graphic src="{concat($pathParam, 'resources/images/job.gif')}"></fo:external-graphic>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<fo:external-graphic src="{concat($pathParam, 'resources/images/personn.gif')}"></fo:external-graphic>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<fo:external-graphic src="{concat($pathParam, 'resources/images/door.png')}"></fo:external-graphic>
								</fo:block>
							</fo:table-cell>
							<fo:table-cell>
								<fo:block>
									<fo:external-graphic src="{concat($pathParam, 'resources/images/phone.png')}"></fo:external-graphic>
								</fo:block>
							</fo:table-cell>
						</fo:table-body>
					</fo:table>
				</fo:static-content>
				
				<!-- pied de page -->
				<fo:static-content flow-name="xsl-region-after">
					<fo:block font-size="12pt" text-align="right">
						Page <fo:page-number/> sur <fo:page-number-citation ref-id="last-page"/>
					</fo:block>

				</fo:static-content>

				<!-- Corps -->
				<fo:flow flow-name="xsl-region-body">
					<fo:block font-size="10pt">
						<xsl:apply-templates select="structure"/>
					</fo:block>
					<fo:block id="last-page"/>
				</fo:flow>
			</fo:page-sequence>
		</fo:root>
	</xsl:template>

	<!-- ========================= -->
	<!-- child element: Structure  -->
	<!-- ========================= -->
	<xsl:template match="structure">

		<fo:block font-weight="bold" space-after="5mm">
			<xsl:if test="level = 1">
				<xsl:attribute name="font-size">20pt</xsl:attribute>
				<xsl:attribute name="color">#3477A4</xsl:attribute>
				<xsl:attribute name="font-style">italic</xsl:attribute>
				<xsl:attribute name="page-break-before">always</xsl:attribute>
				<xsl:attribute name="border-bottom-style">solid</xsl:attribute>
				<xsl:attribute name="border-bottom-color">#3477A4</xsl:attribute>
			</xsl:if>
			<xsl:if test="level = 2">
				<xsl:attribute name="font-size">13pt</xsl:attribute>
				<xsl:attribute name="space-before">5mm</xsl:attribute>
				<xsl:attribute name="text-align">center</xsl:attribute>
				<xsl:attribute name="background-color">#CCCCCC</xsl:attribute>
				<xsl:attribute name="padding-top">5pt</xsl:attribute>
				<xsl:attribute name="padding-bottom">5pt</xsl:attribute>
				<xsl:attribute name="margin-bottom">10pt</xsl:attribute>
			</xsl:if>
			<xsl:if test="level = 3">
				<xsl:attribute name="font-size">9pt</xsl:attribute>
				<xsl:attribute name="space-before">5mm</xsl:attribute>
				<xsl:attribute name="text-align">center</xsl:attribute>
				<xsl:attribute name="text-decoration">underline</xsl:attribute>
				<xsl:attribute name="font-style">italic</xsl:attribute>
				<xsl:attribute name="padding-top">5pt</xsl:attribute>
				<xsl:attribute name="padding-bottom">5pt</xsl:attribute>
				<xsl:attribute name="margin-bottom">10pt</xsl:attribute>
			</xsl:if>
			<xsl:value-of select="complete-name"/>
		</fo:block>
		<fo:block font-size="10pt">
			<xsl:apply-templates select="leader"/>
			<xsl:apply-templates select="assistant-leader"/>
			<xsl:apply-templates select="contact"/>
			<xsl:apply-templates select="membre"/>
			<fo:block font-size="10pt">
				<xsl:apply-templates select="structure"/>
			</fo:block>
		</fo:block>
	</xsl:template>

	<xsl:template match="leader">
		<fo:table table-layout="fixed" width="100%" border-collapse="separate">
			<fo:table-column column-width="6cm"/>
			<fo:table-column column-width="5cm"/>
			<fo:table-column column-width="3cm"/>
			<fo:table-column column-width="3cm"/>
			<fo:table-body>
				<fo:table-row>
					<fo:table-cell>
						<fo:block margin-bottom="5pt">
							<xsl:value-of select="title"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block font-weight="bold">
							<xsl:value-of select="name"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:value-of select="office"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:value-of select="phone"/>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
	</xsl:template>

	<xsl:template match="assistant-leader">
		<fo:table table-layout="fixed" width="100%" border-collapse="separate">
			<fo:table-column column-width="6cm"/>
			<fo:table-column column-width="5cm"/>
			<fo:table-column column-width="3cm"/>
			<fo:table-column column-width="3cm"/>
			<fo:table-body>
				<fo:table-row>
					<fo:table-cell>
						<fo:block margin-bottom="5pt">
							<xsl:value-of select="title"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:value-of select="name"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:value-of select="office"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:value-of select="phone"/>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
	</xsl:template>

	<xsl:template match="contact">
		<fo:table table-layout="fixed" width="100%" border-collapse="separate">
			<fo:table-column column-width="6cm"/>
			<fo:table-column column-width="5cm"/>
			<fo:table-column column-width="3cm"/>
			<fo:table-column column-width="3cm"/>
			<fo:table-body>
				<fo:table-row>
					<fo:table-cell>
						<fo:block margin-bottom="5pt">
							<xsl:value-of select="function"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block font-style="italic">
							<xsl:value-of select="name"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:value-of select="office"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:value-of select="phone"/>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
	</xsl:template>

	<xsl:template match="membre">
		<fo:table table-layout="fixed" width="100%" border-collapse="separate">
			<fo:table-column column-width="6cm"/>
			<fo:table-column column-width="5cm"/>
			<fo:table-column column-width="3cm"/>
			<fo:table-column column-width="3cm"/>
			<fo:table-body>
				<fo:table-row>
					<fo:table-cell>
						<fo:block margin-bottom="5pt">
							<xsl:value-of select="function"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:value-of select="name"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:value-of select="office"/>
						</fo:block>
					</fo:table-cell>
					<fo:table-cell>
						<fo:block>
							<xsl:value-of select="phone"/>
						</fo:block>
					</fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2009. Progress Software Corporation. All rights reserved.

<metaInformation>
	<scenarios>
		<scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="personnes.xml" htmlbaseurl="" outputurl="" processortype="saxon8" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml=""
		          commandline="" additionalpath="" additionalclasspath="" postprocessortype="fop" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator="">
			<advancedProp name="sInitialMode" value=""/>
			<advancedProp name="bSchemaAware" value="false"/>
			<advancedProp name="bXsltOneIsOkay" value="true"/>
			<advancedProp name="bXml11" value="false"/>
			<advancedProp name="iValidation" value="0"/>
			<advancedProp name="bExtensions" value="true"/>
			<advancedProp name="iWhitespace" value="0"/>
			<advancedProp name="sInitialTemplate" value=""/>
			<advancedProp name="bTinyTree" value="true"/>
			<advancedProp name="bUseDTD" value="false"/>
			<advancedProp name="bWarnings" value="true"/>
			<advancedProp name="iErrorHandling" value="fatal"/>
		</scenario>
	</scenarios>
	<MapperMetaTag>
		<MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
		<MapperBlockPosition></MapperBlockPosition>
		<TemplateContext></TemplateContext>
		<MapperFilter side="source"></MapperFilter>
	</MapperMetaTag>
</metaInformation>
-->